
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page isELIgnored="false" %>
<!DOCTYPE html>
<!-- saved from url=(0059)http://demo.demohuo.top/modals/66/6613/demo/admin-list.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <title>后台管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/examproject/manage/css/layui.css" media="all">
    <link rel="stylesheet" href="/examproject/manage/css/admin.css" media="all">
    <link id="layuicss-layer" rel="stylesheet" href="/examproject/manage/css/layer.css" media="all"><link id="layuicss-laydate" rel="stylesheet" href="./laydate.css" media="all"></head>
<style>
    /*设置下拉按钮*/
    .dropbtn {
        background-color: #4CAF50;
        color: white;
        padding: 16px;
        font-size: 16px;
        border: none;
        cursor: pointer;
    }
    .dropdown {
        position: relative;
        display: inline-block;
    }
    .dropdown-content {
        display: none;
        position: absolute;
        background-color: #f9f9f9;
        min-width: 160px;
        box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
        z-index: 1;
    }
    .dropdown-content option {
        color: black;
        padding: 12px 16px;
        text-decoration: none;
        display: block;
    }
    .dropdown-content option:hover {background-color: #f1f1f1}
    .dropdown:hover .dropdown-content {
        display: block;
    }
    .dropdown:hover .dropbtn {
        background-color: #3e8e41;
    }
    .dropbtn{
        text-shadow: 2px 2px 5px red;
    }
    .solid{
        border-style: solid;
    }
    .dropbtn {
        background-color: #4CAF50;
        color: white;
        padding: 16px;
        font-size: 16px;
        border: none;
        cursor: pointer;
    }
    .dropdown {
        position: relative;
        display: inline-block;
    }
    .dropdown-content {
        display: none;
        position: absolute;
        background-color: #f9f9f9;
        min-width: 160px;
        box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
        z-index: 1;
    }
    .dropdown-content a {
        color: black;
        padding: 12px 16px;
        text-decoration: none;
        display: block;
    }
    .dropdown-content a:hover {background-color: #f1f1f1}
    .dropdown:hover .dropdown-content {
        display: block;
    }
    .dropdown:hover .dropbtn {
        background-color: #3e8e41;
    }
    .dropbtn{
        text-shadow: 2px 2px 5px red;
    }
    .solid{
        border-style: solid;
    }
    .mydiv{
        position:absolute;
        left:50%;
        top:50%;
        margin-left:-200px;
        margin-top:-130px;
        display:none;
    }
    .button {
        background-color: #28a745; /* 绿色 */
        align-content: center;
        border: none;
        color: white;
        padding: 14px;
        text-align: center;
        text-decoration: none;
        display: inline-block;
        font-size: 13px;
        margin: 4px 2px;
        cursor: pointer;
    }
    .button4 {border-radius: 12px;}
    fieldset, ol ,li{
        padding:0;
        margin:0;
    }
    fieldset, ol ,li{
        padding:0;
        margin:0;
    }
    ol{
        list-style:none;
    }
    body{
        background:#fff;
        color:#111;
        padding:20px;
    }
    form#payment{
        background:#00ffff;
        -webkit-border-radius:5px;
        border-radius:5px;
        padding:20px;
        width:400px;
    }
    form#payment fieldset{
        border:none;
        margin-bottom:10px;
    }
    form#payment fieldset:last-of-type{ margin-bottom:0; }
    form#payment legend{
        color:#384313;
        font-size:16px;
        font-weight:bold;
        padding-bottom:10px;
        text-shadow:0px 1px 1px #c0d576;
    }
    form#payment > fieldset>legend:before{
        content:"Step" counter(fieldset)":";
        counter-increment:fieldsets;
    }
    form#payment fieldset fieldset legend{
        color:#111;
        font-size:13px;
        font-weight:normal;
        padding-bottom:0;
    }
    form#payment ol li{
        background:#b9cf6a;
        background:rgba(255, 255, 255, 0.3);
        border:#e3ebc3;
        border-color:rgba(255, 255, 255, 0.6);
        border-style:solid;
        border-width:2px;
        -webkit-border-radius:5px;
        line-height:30px;
        padding:5px 10px;
        margin-bottom:2px;
    }
    form#payment ol ol li{
        bakcground:none;
        border:none;
        float:left;
    }
    form#payment label{
        float:left;
        font-size:17px;
        width:110px;
    }
    form#payment fieldset fieldset label{
        background:none no-repeat left 50%;
        line-height:20px;
        padding:0 0 0 30px;
        width:auto;
    }
    form#payment fieldset fieldset label:hover{cursor:pointer;}
    form#payment input:not([type=radio]), form#payment textarea{
        background:#fff;
        border:#fc3 solid 1px;
        -webkit-border-radius:3px;
        outline:none;
        padding:5px;
    }
    * {
        margin: 0;
        padding: 0;
    }

</style>
<body>
<div class="layui-fluid">
    <div class="layui-col-md12">
        <div class="layui-navs">
					<span class="layui-breadcrumb" lay-separator="—" style="visibility: visible;">
						<a href="/examproject/manage/index.jsp">主界面</a><span lay-separator="">—</span>
						<a href="#">班级情况</a><span lay-separator="">—</span>
						<a><cite>作业情况</cite></a>
					</span>
            <a class="layui-btn layui-btn-small" style="line-height:1.6em;float:right;height: 36px;" href="javascript:location.replace(location.href);" title="刷新">
                <i class="layui-icon layui-icon-refresh" style="line-height:36px;font-size: 16px;"></i>
            </a>
        </div>
    </div>
    <div class="layui-col-md12">
        <div class="layui-card">
            <div class="layui-card-body ">

            </div>
            <div class="dropdown"  id="myform">
                <button class="dropbtn">请选择月份</button>
                <div class="dropdown-content" >
                    <a href="/examproject/man/findhom?ctime=01">一月</a>
                    <a href="/examproject/man/findhom?ctime=02">二月</a>
                    <a href="/examproject/man/findhom?ctime=03">三月</a>
                    <a href="/examproject/man/findhom?ctime=04">四月</a>
                    <a href="/examproject/man/findhom?ctime=05">五月</a>
                    <a href="/examproject/man/findhom?ctime=06">六月</a>
                    <a href="/examproject/man/findhom?ctime=07">七月</a>
                    <a href="/examproject/man/findhom?ctime=08">八月</a>
                    <a href="/examproject/man/findhom?ctime=09">九月</a>
                    <a href="/examproject/man/findhom?ctime=10">十月</a>
                    <a href="/examproject/man/findhom?ctime=11">十一月</a>
                    <a href="/examproject/man/findhom?ctime=12">十二月</a>
                </div>
            </div>
            <input type="button" class="button button4" onclick="ondiv()" value="增加">
            <div class="layui-card-body">
                <table class="layui-table layui-form">
                    <thead>
                    <tr>
                        <th>学生编号</th>
                        <th>学生姓名</th>
                        <th>学生班级</th>
                        <th>学生性别</th>
                        <th>考勤</th>
                        <th>作业</th>
                        <th>没做天数</th>
                        <th>备注</th>
                        <th>管理</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <c:forEach items="${list}" var="n" >
                        <tr id="tb" >
                        <td class="solid" style="display:none;">${n.id}"</td>
                        <td class="solid">${n.studentId}</td>
                        <td class="solid">${n.stname}</td>
                        <td class="solid">${n.classId}</td>
                        <td class="solid">${n.stsex}</td>
                        <td class="solid">${n.checkIn}</td>
                        <td class="solid">${n.work}</td>
                        <td class="solid">${n.ctime}</td>
                        <td class="solid">${n.remark}</td>
                        <td>
                            <a class="layui-btn layui-btn-sm layui-btn-danger" title="删除" onclick="return confirm('你确定删除吗')" id="testLink" href="/examproject/man/delhomht?id=${n.id}&ctime=${n.ctime}"><i class="layui-icon layui-icon-delete"></i>删除</a>
                        </td>
                    </tr>
                    </c:forEach>
                    </tbody>
                </table>
            </div>
            <%--<c:forEach begin="${pb.end}" end="${pb.end }" var="k">
            <c:set var="p" value="${k==pb.curPage?'cur':''}"></c:set>
            <a class="${p}" href='/sc/User/cxksbj?p=${k}'>一共${pb.end }页</a>
        </c:forEach>
            <a href='/sc/User/cxksbj?p=1&classId=1'>首页</a>
            <a href='/sc/User/cxksbj?p=${last}&classId=1'>上一页</a>
            <a href='/sc/User/cxksbj?p=${next}&classId=1'>下一页</a>
            <a href='/sc/User/cxksbj?p=${pb.end}&classId=1'>尾页</a>--%>
        </div>
    </div>
</div>

<div class="mydiv" id="mydiv" ><!-- 增加 -->

    <form action="/examproject/man/addidht" method="post" id=payment>
        <fieldset>
            <a class="gb" href="#" style="width:100%; margin-left:99%;margin-right:0%;height: 10px">X</a>
            <ol>

                <li>
                    <label >姓名:</label>
                    <input type="text"  name="stname" required>
                </li>>
                <li>
                    <label >考勤:</label>
                    <input type="text"  name="checkIn" required>
            </li>>
                <li>
                    <label >作业:</label>
                    <input type="text"  name="work" required>
            </li>>
                <li>
                    <label >时间:</label>
                    <input type="date" name="ctime" placeholder="日期" required/>
                </li>>
                <li>
                    <label >备注:</label>
                    <input type="text"  name="remark" required>
            </li>>
            </ol>
        </fieldset>

        <fieldset colspan=2>
            <button type="submit" onclick="aaaa()" class="button button4">添加</button>
        </fieldset>
    </form>


</div>
<script>
    var bx=<%=session.getAttribute("bx")%>;
    if(bx==false){
        alert("用户不存在");
    }

</script>
<script>
    window.onload=function() {
            var xmlhttp=new XMLHttpRequest();
            xmlhttp.open("GET","/examproject/man/cxsybjht",true);
            xmlhttp.send();
            xmlhttp.onreadystatechange=function(){
                if(xmlhttp.readyState==4 && xmlhttp.status==200){
                    var sz=JSON.parse(xmlhttp.responseText);
                    var obj=document.querySelector("#btn_select");
                    for(var i=0;i<sz.length;i++){
                        var op=new Option(sz[i].className,sz[i].classId);
                        obj.appendChild(op);
                    }
                }
            }


        var mydiv = document.querySelector(".mydiv");
        var as = document.querySelectorAll(".xg");
        for (var i = 0; i < as.length; i++) {
            as[i].onclick = function () {
                console.log(this);
                //显示盒子
                mydiv.style.display = 'block';
                var tr = this.parentNode.parentNode;
                var tds = tr.children;
                var inps = document.querySelectorAll(".myfm input");
                for (var k = 0; k < 5; k++) {
                    inps[k].value = tds[k].innerHTML;
                }
                console.log(tr);
            }
        }
        //点空白区域时
        var gba = document.querySelector(".gb");
        gba.onclick = function () {
            mydiv.style.display = 'none';
        }

    }
    function submitForm(){
        var form = document.getElementById("myform");
        form.submit();
    }
    function submitForm1(){
        var form = document.getElementById("myform1");
        form.submit();
    }
    function ondiv(){
        document.getElementById("mydiv").style.display="block";
    }

</script>
</body>
</html>
